<?php
//phpinfo();exit;

$redis = new Redis();
$redis->connect('127.0.0.1',6379);
$redis->set('foo','This is test string!');
echo $redis->get('foo');
echo '<br/>';

//存储数据到列表中
   $redis->lpush("tutorial-list", "Redis");
   $redis->lpush("tutorial-list", "Mongodb");
   $redis->lpush("tutorial-list", "Mysql");
   // 获取存储的数据并输出
   $arList = $redis->lrange("tutorial-list", 0 ,5);
   echo "Stored string in redis:: ";
echo '<br/>';
   print_r($arList);
echo '<br/>';
echo '<br/>';



 echo "Connection to server sucessfully";
echo '<br/>';
   // 获取数据并输出
   $arList = $redis->keys("*");
   echo "Stored keys in redis:: ";
echo '<br/>';
   print_r($arList);
echo '<br/>';




?>
